package com.hsy.linemoney.common;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.hsy.linemoney.R;

/**
 * Created by MartinKent on 2016/9/8.
 */
public class HomeExechangeArea extends ViewGroup {
    private TextView fromLabel, toLabel, leftSpinner, rightSpinner;
    private View switchButton;

    public HomeExechangeArea(Context context) {
        super(context);
    }

    public HomeExechangeArea(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public HomeExechangeArea(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        fromLabel = (TextView) findViewById(R.id.label_from);
        toLabel = (TextView) findViewById(R.id.label_to);
        leftSpinner = (TextView) findViewById(R.id.left_spinner);
        rightSpinner = (TextView) findViewById(R.id.right_spinner);
        switchButton = findViewById(R.id.switch_exchange_way);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        int switchButtonWidth = switchButton.getMeasuredWidth();
        int switchButtonHeight = switchButton.getMeasuredHeight();
        int leftSpinnerWidth = leftSpinner.getMeasuredWidth();
        int leftSpinnerHeight = leftSpinner.getMeasuredHeight();
        int rightSpinnerWidth = rightSpinner.getMeasuredWidth();
        int rightSpinnerHeight = rightSpinner.getMeasuredHeight();
        int fromLabelWidth = fromLabel.getMeasuredWidth();
        int fromLabelHeight = fromLabel.getMeasuredHeight();
        int toLabelWidth = toLabel.getMeasuredWidth();
        int toLabelHeight = toLabel.getMeasuredHeight();
    }
}
